package training.hari.singleton;

public class Singleton {
	
	private static Singleton instance;
	
	//this is not related to singleton such as but for FYI
	static{
		System.out.println("This is a static block invoked during class loading");
	}
	
	public static Singleton getInstance()
	{
		if(instance == null){
			instance = new Singleton();
		}
		return instance;
	}
	
	private Singleton(){
		
		System.out.println("within constructor");
	}

	
}
